{% extends "base.html"%}
{% block title %}
	{% if typeid = 0%}
		学无止境
	{% else %}
		学无止境-{{ type.type }}
	{% endif %}
	
{% endblock %}
{% block banner %}
	<div id='top-sec-nav' style='border-bottom: 2px solid rgba(173,8,212,0.4);'>
		<div class='banner-nav-left' style='background:rgba(173,8,212,0.4);'>
			<a href='/blog/learn/'>
				<p>学无止境</p>
			</a>	
			{% if typeid = 0%}
				<p></p>
			{% else %}
				<a><p>--{{ type.type }}</p></a>
			{% endif %}
		</div>
		<div class='banner-nav-lable'><p>清·刘开《问说》：“理无专在，而学无止境也，然则问可少耶？”</p></div>
	</div>
{% endblock %}
{% block container %}
		<div class="blog-view">
		<div class='blog-left'>
			
			{% for blog in blogs %}
			<div class='blog-info'>
				<div id='blog-title' style='height:50px;float:left;'>
					<h3><a href='/blog/article/{{blog.id}}/'>{{ blog.title }}</a></h3>
				</div>
				{% if blog.author.first_name != ''%}
					<div style='float:right;margin-right:10px;text-align:right;height:50px;'><h5>{{ blog.author.first_name }}{{blog.author.last_name}} {{ blog.timestamp }} 浏览({{ blog.clicktime}})</h5></div>
				{% else %}
					<div style='float:right;margin-right:10px;text-align:right;height:50px;'><h5>{{ blog.author }} {{ blog.timestamp }} 浏览({{ blog.clicktime}})</h5></div>
				{% endif %}
			</div>
			{% endfor %}	
			
			<div class="pagination-all">
				<span class="step-links">
					 {% if blogs.has_previous %}
						 <a class='paginator' title='previous' href='?page=1'><span> 首页 </span></a>
				         <a class='paginator' title='previous' href='?page={{ blogs.previous_page_number }}'><span> 上一页 </span></a>
			        
					 {% else %}
					 	<a class='paginator' title='previous' href='?page=1'><span> 首页 </span></a>
					 	<span> 上一页 </span>
					 {% endif %}
					 {% for page in pages_range %}
					     {% if page = blogs.number %}
					         <a class='paginator_current' title='current:{{ page }}'><span class='page'>{{ page }}</span></a>
					     {% else %}
					         <a class='paginator' href='?page={{ page }}' title='{{ page }}'><span class='page'>{{ page }}</span></a>
					     {% endif %}
					 {% endfor %}
					 {% if blogs.has_next%}
					     <a class='paginator' title='next' href='?page={{ blogs.next_page_number }}'><span>下一页</span></a>
					     <a class='paginator' title='previous' href='?page={{ blogs.paginator.num_pages }}'><span> 尾页 </span></a>
					
					 {% else %}
					 	 <span style='margin-left: 0px;'>下一页</span>
					 	 <a class='paginator' title='previous' href='?page={{ blogs.paginator.num_pages }}'><span> 尾页 </span></a>
					 {% endif %}
				 </span>
			</div>
		</div>
		<div class='blog-right' style='margin-top:10px; border-left:2px solid rgba(206, 0, 0, 0.5);'>
			<div style='border-bottom: 1px solid rgba(204, 191, 49, 0.5);'>
				<p class='fenlei-p'>分类</p>
			</div>
			<div id='learn-types'>
				<div class='learn-type'>
					{% for type in types %}
						<a href='/blog/learn/{{type.id}}' target="_blank"><p>{{ type.type}}</p></a>
					{% endfor %}
				</div>
			</div>
			<div style='border-bottom: 1px solid rgba(81, 204, 49, 0.5);'><p class='fenlei-p'>blog推荐</p></div>
			<div class='new-blog'>
				{% for new in newblogs %}
					<a href='/blog/article/{{ new.id }}/'><div><p>{{ new.title }}</p></div></a>
				{% endfor %}
			</div>
			<div style='border-bottom: 1px solid rgba(72, 49, 204, 0.5);'><p class='fenlei-p'>旅行日志</p></div>
			<div class='new-blog'>
				{% for new in travels %}
					<a href='/blog/travel/{{ new.id }}/'><div><p>{{ new.title }}</p></div></a>
				{% endfor %}
			</div>
			<div style='border-bottom: 1px solid rgba(200, 108, 212, 0.5);'><p class='fenlei-p'>图片欣赏</p></div>
			<div id='blog-list-right-midd'>
				<ul class="blog-list-right-banner">   
					{% for pic in pics %}
					<li><a href='/blog/pic/{{pic.id}}' target='view_window'><img alt="{{pic.title}}" src="/media/{{pic.first_pic}}" style='width:100%;height:100%;'></a></li> 
					{% endfor%}
				 </ul> 
			</div>
		</div>
	</div>
{% endblock %}